package com.bjpowernode;

import com.bjpowernode.ba02.SomeService;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class MyTest01 {
    @Test
    public void test01(){
        String configure= "ba02/applicationContext.xml";
        ApplicationContext applicationContext=new ClassPathXmlApplicationContext(configure);
        //从容器中获取目标对象
        SomeService proxy=(SomeService) applicationContext.getBean("service");
        //通过代理对象执行方法，实现目标方法功能增强
        String s=proxy.doOther("李红磊",21);
        System.out.println(s);
    }
}
